package playn.game.menu;

import static playn.core.PlayN.graphics;
import playn.core.GroupLayer;
import playn.game.core.State;
import playn.game.menu.states.Complete;
import playn.game.menu.states.Gameover;
import playn.game.menu.states.Levels;
import playn.game.menu.states.Pause;
import playn.game.menu.states.Start;
import playn.game.menu.states.Action;

public class Menu {

	public GroupLayer layer;
	
	public static Start  START;
	public static Levels LEVELS;
	public static Pause  PAUSE;
	public static Action ACTION;
	public static Complete CONTINUE;
	public static Gameover GAMEOVER;
	
	public State currentState=null;
	
	public Menu(){
		layer=graphics().createGroupLayer();
		
		START =new Start(layer);
		LEVELS=new Levels(layer);
		PAUSE =new Pause(layer);
		ACTION =new Action(layer);
		CONTINUE =new Complete(layer);
		GAMEOVER =new Gameover(layer);

	}

	public void switchTo(State state){
		System.out.println("switching out");

		currentState.disable();
		currentState.hide();
		currentState.next=state;
	}
	
	public void update(float delta) {
		if(currentState!=null){
			currentState.update(delta);
		}
	}
	
}
